$(window).load(function(){
	function getPersonInfoSucFn(data){
		if(data.code == "0000"){
			var introMsg = data.data;
			var text = $('<img class="info-back" src="images/info-back.png" /><img class="info-img" src="'+introMsg.Headimgurl+'" />'+
				'<p>'+introMsg.Nickname+'</p>');
			text.appendTo($(".info-msg"));
		}else {
			warnTip($(".black-bg"),"获取用户信息失败！",1000);
		}
	}

	function getStatusSucFn(data){
		if(data.code == "0000"){
			if(data.data== true){
				warnTip($(".black-bg"),"您已绑定账号，请勿重复绑定！",1000);
			}
			else{
				window.location.href = "bind.html";
			}
		}else {
			warnTip($(".black-bg"),"获取用户信息失败！",1000);
		}
	}

	var urlGetPersonInfo = wxAddress+"/weixin/user/getPersonInfo";
	ajaxEncapsulation(urlGetPersonInfo, getPersonInfoSucFn, "", "GET", "true");

	$(".info-text li").on("click", function(){
		var index = $(this).index();
		if(index == 0){
			alert("订单管理");
		}else if(index == 1){
			alert("客户管理");
		}else if(index == 2){
			alert("分享管理");
		}else if(index == 3){
			var urlGetStatus = wxAddress+"/weixin/bind/getStatus";
			ajaxEncapsulation(urlGetStatus, getStatusSucFn, "", "GET", "true");
		}
	})
});